package com.song.controller;

import com.song.service.impl.ThreadServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @Author Klys
 * @Date 2023/7/2 14:15
 * @Description
 * @Version 1.0
 */
@RestController
@RequestMapping("/sms")
@Slf4j
@Api(tags = "sms接口")
public class SmsController {

    @Resource
    private ThreadServiceImpl threadService;

    @RequestMapping("/test")
    @ApiOperation("test")
    public String test() {
        return "test";
    }

    @RequestMapping("/send")
    public String send() throws InterruptedException {
        log.info("进入send方法！");
        System.out.println(threadService == null);
        //异步执行，并不嫩拿到结果
        String send = threadService.send("15638279964");
        return send;
    }
}